<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="../include/include.jsp"%>
<title>${title}</title>
<meta name="description" content="${description}" />
<meta name="Keywords" content="${keyword}" />
<link rel="stylesheet" type="text/css" href="${cssPath}/resources/css/buy-index.css">
</head>
<body>
	<%@ include file="../include/head.jsp"%>
	<!--#cnt 中间的内容-->
	<div id="cnt">
		<div class="cnt-wrap">
			<div class="left-cnt f-fl">
				<!--path-wrap 面包屑-->
				<div class="path-wrap">
					<div class="path f-fl">
						<span>当前位置：</span>
						<a href="${contextPath}">二手车网络超市</a>
						<span>&gt;</span>
						<a href="${contextPath}/buycar/">${city}认证二手车</span></a>
						<c:if test="${not empty cnds.brand}">
						<span>&gt;</span>
						<a href="${contextPath}/${cnds.brand.key}/">${city}二手${cnds.brand.value}</a>
						</c:if>
						<c:if test="${not empty cnds.series}">
						<span>&gt;</span>
						<a href="${contextPath}/${cnds.brand.key}/${cnds.series.key}/">${city}二手${cnds.series.value}</a>
						</c:if>
					</div>
					<a href="${contextPath}/buy.html" class="f-fr publish">发布二手车求购信息</a>
				</div>
				<!--path-wrap end-->
				<!-- notcar-warp 无车源 -->
				<c:if test="${empty cars}">
					<div class="notcar-warp">
	                    <p>没有找到相关车源，您可以调整以下筛选条件。</p>
	                </div>
                </c:if>
				<!-- notcar-warp end -->
				<!--filter-wrap 条件筛选-->
				<div class="filter-wrap">
					<c:if test="${not empty showCnds}">
					<div class="elected-wrap">
						<div class="label f-fl">
							已选择：
						</div>
						<ul class="elected-item f-fl">
							<c:forEach var="cnd" items="${cnds}">
							<c:if test="${cnd.value.name != '排序' && cnd.value.name != '页码' }">
							<li class="elected-del mmche-icon" href="${contextPath}${cnd.value.delUrl}">
								${cnd.value.name }：${cnd.value.value}
							</li>
							</c:if>
							</c:forEach>
						</ul>
						<a href="${contextPath}/buycar/" class="del-all f-fr">清除所选条件</a>
						<div class="f-clear"></div>
					</div>
					</c:if>
					<ul class="filter-list">
						<li>
							<div class="label f-fl">
								品&nbsp;&nbsp;牌：
							</div>
							<ul class="filter-item f-fl">
								<li>
									<a href="${contextPath}${all_brand_url}">
										全部
									</a>
								</li>
								<c:forEach var="brand" items="${brands}">
								<li>
									<a href="${contextPath}${fn:replace(brand_url,'BRAND',brand.enname)}" ${cnds.brand.key == brand.enname ? 'class="crt-item"' : ''}><!--选中的项添加class="crt-item"-->
										${brand.name }
									</a>
								</li>
								</c:forEach>
							</ul>
							<span class="more mmche-icon f-fr">
								更多
							</span>
							<span  class="more-close mmche-icon f-fr hide">
								收起
							</span>
						</li>
						<c:if test="${not empty serieses}">
						<li>
							<div class="label f-fl">
								车&nbsp;&nbsp;系：
							</div>
							<ul class="filter-item f-fl">
								<li>
									<a href="${contextPath}${all_series_url}">
										全部
									</a>
								</li>
								<c:forEach var="series" items="${serieses}">
								<li>
									<a href="${contextPath}${fn:replace(series_url,'SERIES',series.enname)}" ${cnds.series.key == series.enname ? 'class="crt-item"' : ''}>
										${series.name }
									</a>
								</li>
								</c:forEach>
							</ul>
							<span class="more mmche-icon f-fr">
								更多
							</span>
							<span  class="more-close mmche-icon f-fr hide">
								收起
							</span>
						</li>
						</c:if>
						<li>
							<div class="label f-fl">
								价&nbsp;&nbsp;格：
							</div>
							<ul class="filter-item f-fl">
								<li>
									<a href="${contextPath}${all_price_url}">
										全部
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H1')}" ${cnds.price.key == 'H1' ? 'class="crt-item"' : ''}>
										3万以下
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H2')}" ${cnds.price.key == 'H2' ? 'class="crt-item"' : ''}>
										3-5万
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H3')}" ${cnds.price.key == 'H3' ? 'class="crt-item"' : ''}>
										5-8万
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H4')}" ${cnds.price.key == 'H4' ? 'class="crt-item"' : ''}>
										8-10万
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H5')}" ${cnds.price.key == 'H5' ? 'class="crt-item"' : ''}>
										10-15万
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H6')}" ${cnds.price.key == 'H6' ? 'class="crt-item"' : ''}>
										15-20万
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H7')}" ${cnds.price.key == 'H7' ? 'class="crt-item"' : ''}>
										20-50万
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(price_url,'PRICE','H8')}" ${cnds.price.key == 'H8' ? 'class="crt-item"' : ''}>
										50万以上
									</a>
								</li>
							</ul>
						</li>
						<li>
							<div class="label f-fl">
								车&nbsp;&nbsp;龄：
							</div>
							<ul class="filter-item f-fl">
								<li>
									<a href="${contextPath}${all_age_url}">
										全部
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(age_url,'AGE','A1')}" ${cnds.age.key == 'A1' ? 'class="crt-item"' : ''}>
										1年以内
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(age_url,'AGE','A2')}" ${cnds.age.key == 'A2' ? 'class="crt-item"' : ''}>
										2年以内
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(age_url,'AGE','A3')}" ${cnds.age.key == 'A3' ? 'class="crt-item"' : ''}>
										3年以内
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(age_url,'AGE','A4')}" ${cnds.age.key == 'A4' ? 'class="crt-item"' : ''}>
										3-5年
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(age_url,'AGE','A5')}" ${cnds.age.key == 'A5' ? 'class="crt-item"' : ''}>
										5-8年
									</a>
								</li>
								<li>
									<a href="${contextPath}${fn:replace(age_url,'AGE','A6')}" ${cnds.age.key == 'A6' ? 'class="crt-item"' : ''}>
										8年以上
									</a>
								</li>
							</ul>
						</li>
						<li class="f-ov">
							<div class="label f-fl">
								更&nbsp;&nbsp;多：
							</div>
							<c:if test="${not empty carTypes}">
							<div class="filter-item-wrap f-fl ${not empty cnds.type ? 'filter-item-crt' : ''}">
								<div class="sel-down-icon mmche-icon">
									${not empty cnds.type ? cnds.type.value : '类型'}
								</div>
								<ul class="items">
									<li>
										<a href="${contextPath}${all_type_url}">不限</a>
									</li>
									<c:set var="i" value="0"/>
									<c:forEach var="type" items="${carTypes}">
									<c:set var="i" value="${i+1}"/>
									<c:set var="key" value="T${i}"/>
									<li>
										<a href="${contextPath}${fn:replace(type_url,'TYPE',key)}">${type.desc}</a>
									</li>
									</c:forEach>
								</ul>
							</div>
							</c:if>
							<c:if test="${not empty tranTypes}">
							<div class="filter-item-wrap f-fl ${not empty cnds.tran ? 'filter-item-crt' : ''}">
								<div class="sel-down-icon mmche-icon">
									${not empty cnds.tran ? cnds.tran.value : '变速箱'}
								</div>
								<ul class="items">
									<li>
										<a href="${contextPath}${all_tran_url}">不限</a>
									</li>
									<c:set var="i" value="0"/>
									<c:forEach var="tran" items="${tranTypes}">
									<li>
										<a href="${contextPath}${fn:replace(tran_url,'TRAN',tran.code)}">${tran.desc}</a>
									</li>
									</c:forEach>
								</ul>
							</div>
							</c:if>
							<div class="filter-item-wrap f-fl ${not empty cnds.pl ? 'filter-item-crt' : ''}">
								<div class="sel-down-icon mmche-icon">
									${not empty cnds.pl ? cnds.pl.value : '排量'}
								</div>
								<ul class="items add-items">
									<li>
										<a href="${contextPath}${all_pl_url}">不限</a>
									</li>
									<li>
										<a href="${contextPath}${fn:replace(pl_url,'PL','E1')}">1.0L以下</a>
									</li>
									<li>
										<a href="${contextPath}${fn:replace(pl_url,'PL','E2')}">1.1-1.5L</a>
									</li>
									<li>
										<a href="${contextPath}${fn:replace(pl_url,'PL','E3')}">1.6-2.0L</a>
									</li>
									<li>
										<a href="${contextPath}${fn:replace(pl_url,'PL','E4')}">2.1-2.5L</a>
									</li>
									<li>
										<a href="${contextPath}${fn:replace(pl_url,'PL','E5')}">2.6-3.0L</a>
									</li>
									<li>
										<a href="${contextPath}${fn:replace(pl_url,'PL','E6')}">3.0L以上</a>
									</li>
								</ul>
							</div>
							<c:if test="${not empty colors}">
							<div class="filter-item-wrap f-fl ${not empty cnds.color ? 'filter-item-crt' : ''}">
								<div class="sel-down-icon mmche-icon">
									${not empty cnds.color ? cnds.color.value : '颜色'}
								</div>
								<ul class="items add-items">
									<li>
										<a href="${contextPath}${all_color_url}">不限</a>
									</li>
									<c:set var="i" value="0"/>
									<c:forEach var="color" items="${colors}">
									<c:set var="i" value="${i+1}"/>
									<c:set var="key" value="C${i}"/>
									<li>
										<a href="${contextPath}${fn:replace(color_url,'COLOR',key)}">${color.desc}</a>
									</li>
									</c:forEach>
								</ul>
							</div>
							</c:if>
						</li>
					</ul>
				</div>
				<!--filter-wrap end-->
				<c:if test="${not empty cars }">
				<!--sch-result-wrap 搜索结果列表-->
				<div class="sch-result-wrap">
					<div class="sch-hd-wrap">
						<h1 class="f-fl">
							${city}二手车交易网
						</h1>
						<span class="f-fr car-number">
							共<span class="number">${pageMan.totalRow}</span>台认证二手车
						</span>
						<div class="f-clear"></div>
						<ul class="sch-hd">
							<li ${empty cnds.sort ? 'class="crt-sort"' :''}>
								<a href="${contextPath}${all_sort_url}">
									默认排序
								</a>
							</li>
							<li ${cnds.sort.key=='U1' || cnds.sort.key=='D1' ? 'class="crt-sort"' :''}>
								<a href="${contextPath}${fn:replace(sort_url,'SORT',cnds.sort.key=='D1' ? 'U1' : 'D1')}" class="sch-label f-ib">
									<span>发布日期</span><span class="mmche-icon f-ib ${cnds.sort.key=='D1' ? 'arrow-down':'arrow-up'}"></span><!--箭头向上：class="arrow-up"。箭头向下：class="arrow-down"-->
								</a>
							</li>
							<li ${cnds.sort.key=='U2' || cnds.sort.key=='D2' ? 'class="crt-sort"' :''}>
								<a href="${contextPath}${fn:replace(sort_url,'SORT',cnds.sort.key=='U2' ? 'D2' : 'U2')}" class="sch-label f-ib">
									<span>价格</span><span class="mmche-icon f-ib ${cnds.sort.key=='D2' ? 'arrow-down':'arrow-up'}"></span>
								</a>
							</li>
							<li ${cnds.sort.key=='U3' || cnds.sort.key=='D3' ? 'class="crt-sort"' :''}>
								<a href="${contextPath}${fn:replace(sort_url,'SORT',cnds.sort.key=='U3' ? 'D3' : 'U3')}" class="sch-label f-ib">
									<span>车龄</span><span class="mmche-icon f-ib ${cnds.sort.key=='D3' ? 'arrow-down':'arrow-up'}"></span>
								</a>
							</li>
							<li ${cnds.sort.key=='U4' || cnds.sort.key=='D4' ? 'class="crt-sort"' :''}>
								<a href="${contextPath}${fn:replace(sort_url,'SORT',cnds.sort.key=='U4' ? 'D4' : 'U4')}" class="sch-label f-ib">
									<span>车显里表</span><span class="mmche-icon f-ib ${cnds.sort.key=='D4' ? 'arrow-down':'arrow-up'}"></span>
								</a>
							</li>
						</ul>
					</div>
					<ul class="hot-pro-wrap">
						<c:forEach var="car" items="${cars}">
						<li class="hot-pro">
							<div class="hot-pro-img v-h-center">
								<a href="${contextPath}/car/${car.id}.html">
									<img src="${car.imgPath}/${car.indexMainPicName}" title="${car.online.title}" alt="${car.online.title}" class="pro-img" width="200px" height="160px" />
								</a>
							</div>
							<div class="pro-info">
								<div class="pro-name">
									<a href="${contextPath}/car/${car.id}.html">
										${car.online.title}
									</a>
								</div>
								<ul class="detail-info">
									<li>
										<span class="label">首次上牌：</span><span>${car.registerMonth}</span>
									</li>
									<li>
										<span class="label">里程：</span><span>${car.mileage}万公里</span>
									</li>
									<li>
									<span class="label">新车价：</span><span>${car.newCarPrice}</span><span class="label">（含置购税）</span>
									</li>
								</ul>
								<div>
									麦麦车一口价：<span class="price-sum">￥${car.price}</span>
								</div>
							</div>
						</li>
						</c:forEach>
					</ul>
					<!--商品列表 end-->
					<div class="f-clear"></div>
				</div>
				<!--sch-result-wrap end-->
				<c:if test="${pageMan.totalPage > 1}">
				<!--pagination-wrap 页码-->
				<div class="pagination">
					<div class="pagination-wrap">
				        <c:if test="${pageMan.pageNo!=1}">
						<a href="${contextPath}${fn:replace(page_url,'PAGE',pageMan.pageNo-1)}" class="mmche-icon pre-positive page">
							上一页
						</a>
						</c:if>
						<c:if test="${pageMan.pageNo ==1}">
						<span class="mmche-icon pre-negative page">
							上一页
						</span>
						</c:if>
						<c:if test="${pageMan.pageStart>1}">
						<a href="${contextPath}${fn:replace(page_url,'PAGE',1)}">
							1
						</a>
						</c:if>
						<c:if test="${pageMan.pageStart>2}">
						<a href="${contextPath}${fn:replace(page_url,'PAGE',2)}">
							2
						</a>
						</c:if>
						<c:if test="${pageMan.pageStart>3}">
		 					<span>...</span>
		 				</c:if>
						<c:forEach var="i" begin="${pageMan.pageStart}" end="${pageMan.pageEnd}" step="1">
							<a href="${contextPath}${fn:replace(page_url,'PAGE',i)}" ${pageMan.pageNo == i ? 'class="crt-pagination"' : ''}>${i}</a>
	 					</c:forEach>
	 					<c:if test="${pageMan.pageEnd<pageMan.totalPage-2}">
		 					<span>...</span>
		 				</c:if>
						<c:if test="${pageMan.pageEnd<pageMan.totalPage-1}">
						<a href="${contextPath}${fn:replace(page_url,'PAGE',pageMan.totalPage-1)}">
							${pageMan.totalPage-1}
						</a>
						</c:if>
						<c:if test="${pageMan.pageEnd<pageMan.totalPage}">
						<a href="${contextPath}${fn:replace(page_url,'PAGE',pageMan.totalPage)}">
							${pageMan.totalPage}
						</a>
						</c:if>
						<c:if test="${pageMan.pageNo != pageMan.totalPage}">
						<a href="${contextPath}${fn:replace(page_url,'PAGE',pageMan.pageNo+1)}" class="mmche-icon next-positive page">
							下一页
						</a>
						</c:if>
						<c:if test="${pageMan.pageNo == pageMan.totalPage}">
						<span class="mmche-icon next-negative page">
							下一页
						</span>
						</c:if>
						<div class="f-clear"></div>
					</div>
				</div>
				<!--pagination-wrap end-->
				</c:if>
				</c:if>
				<c:if test="${empty cars}">
				<!-- other-warp 同品牌车源 -->
				<div class="sch-result-wrap">
					<div class="sch-hd-wrap">
						<h1 class="f-fl">
							您可能感兴趣的车源
						</h1>
						<div class="f-clear"></div>
						<ul class="sch-hd">
						</ul>
					</div>
					<ul class="hot-pro-wrap">
						<c:forEach var="car" items="${hotCars}">
						<li class="hot-pro">
							<div class="hot-pro-img v-h-center">
								<a href="${contextPath}/car/${car.id}.html">
									<img src="${car.imgPath}/${car.indexMainPicName}" title="${car.online.title}" alt="${car.online.title}" class="pro-img" width="200px" height="160px" />
								</a>
							</div>
							<div class="pro-info">
								<div class="pro-name">
									<a href="${contextPath}/car/${car.id}.html">
										${car.online.title}
									</a>
								</div>
								<ul class="detail-info">
									<li>
										<span class="label">首次上牌：</span><span>${car.registerMonth}</span>
									</li>
									<li>
										<span class="label">里程：</span><span>${car.mileage}万公里</span>
									</li>
									<li>
									<span class="label">新车价：</span><span>${car.newCarPrice}</span><span class="label">（含置购税）</span>
									</li>
								</ul>
								<div>
									麦麦车一口价：<span class="price-sum">￥${car.price}</span>
								</div>
							</div>
						</li>
						</c:forEach>
					</ul>
					<!--商品列表 end-->
					<div class="f-clear"></div>
				</div>
				<!-- other-warp end-->
				</c:if>
			</div>
			<div class="right-cnt f-fr">
				<c:if test="${not empty promoCars }">
				<!--cnt-wrap 限时特卖-->
				<div class="cnt-wrap">
					<div class="cnt-hd-wrap">
						<h2 class="f-fl">
							限时特卖
						</h2>
						<div class="f-clear"></div>
					</div>
					<ul class="cnt-list">
						<c:forEach var="promoCar" items="${promoCars}" varStatus="status">
						<li ${status.last ? 'class="border-none"':'' }>
							<div class="cnt-pro-img v-h-center">
								<a href="${contextPath}/car/${promoCar.id}.html">
									<img src="${promoCar.imgPath}/${promoCar.indexMainPicName}" title="${promoCar.online.title}" alt="${promoCar.online.title}"  width="155px" height="124px"/>
								</a>
							</div>
							<div class="text-ellipsis cnt-pro-name">
								<a href="${contextPath}/car/${promoCar.id}.html">
									${promoCar.online.title}
								</a>
							</div>
							<div class="cnt-pro-info text-ellipsis">
								<span>${promoCar.registerMonth}</span>&nbsp;&nbsp;<span>${promoCar.mileage}万公里</span>
							</div>
							<div class="cnt-pro-info text-ellipsis">
								麦麦车一口价：<span class="price-sum">
								￥${promoCar.price}
							</span>
							</div>
						</li>
						</c:forEach>
					</ul>
				</div>
				<!--cnt-wrap end-->
				</c:if>
				<!--cnt-wrap 历史浏览-->
				<c:if test="${not empty viewdCars }">
				<div class="cnt-wrap">
					<div class="cnt-hd-wrap">
						<h2 class="f-fl">
							历史浏览
						</h2>
						<div class="f-clear"></div>
					</div>
					<ul class="cnt-list">
						<c:forEach var="historyCar" items="${viewdCars}" varStatus="status">
						<li ${status.last ? 'class="border-none"':'' }>
							<div class="cnt-pro-img v-h-center">
								<a href="${contextPath}/car/${historyCar.id}.html">
									<img src="${historyCar.imgPath}/${historyCar.indexMainPicName}" title="${historyCar.online.title}" alt="${historyCar.online.title}"  width="155px" height="124px"/>
								</a>
							</div>
							<div class="text-ellipsis cnt-pro-name">
								<a href="${contextPath}/car/${historyCar.id}.html">
									${historyCar.online.title}
								</a>
							</div>
							<div class="cnt-pro-info text-ellipsis">
								<span>${historyCar.registerMonth}</span>&nbsp;&nbsp;<span>${historyCar.mileage}万公里</span>
							</div>
							<div class="cnt-pro-info text-ellipsis">
								麦麦车一口价：<span class="price-sum">
								￥${historyCar.price}
							</span>
							</div>
						</li>
						</c:forEach>
					</ul>
				</div>
				<!--cnt-wrap end-->
				</c:if>
			</div>
			<div class="f-clear"></div>
		</div>
	</div>
	<!--#cnt end-->
	<%@ include file="../include/foot.jsp"%>
	<script type="text/javascript" src="${jsPath}/resources/js/buycar.js"></script>
	<script>
	$(document).ready(function(){
	});
	</script>
</body>
</html>